package httplib

import (
	"encoding/json"
	"net/http"
)

type Response struct {
	body       []byte
	statusCode int
	header     *http.Header
	cookie     []*http.Cookie
}

func (r *Response) Bytes() []byte {
	return r.body
}

func (r *Response) String() string {
	return string(r.body)
}

func (r *Response) JSON(v interface{}) error {
	return json.Unmarshal(r.body, v)
}

func (r *Response) StatusCode() int {
	return r.statusCode
}

func (r *Response) Headers() *http.Header {
	return r.header
}

func (r *Response) Cookies() []*http.Cookie {
	return r.cookie
}
